use axum::{
    routing::{get, post},
    Router,
};
use tower_http::trace::TraceLayer;
mod handlers;
mod model;
mod utils;

#[tokio::main]
async fn main() {
    // build our application with a single route]
    utils::open_debug();
    let app = Router::new()
        .route("/plain_text", get(handlers::plain_text))
        .route("/users", post(handlers::create_user))
        .route("/random", get(handlers::random_url))
        .route("/", get(handlers::greet))
        .layer(TraceLayer::new_for_http());

    // run it with hyper on localhost:3000
    axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
        .serve(app.into_make_service())
        .await
        .unwrap();
}
